import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    token: null,
    activeTab: null,
    activeMenu: null,
    activePaper: null,
    activeMember: null,
    activeAlbum: null,
    paperListBlur: true,
    memberListBlur: true,
    albumListBlur: true
  },
  mutations: {
    setToken (state, token) {
      state.token = token
    },
    setActiveMenu (state, activeMenu) {
      state.activeMenu = activeMenu
    },
    setActiveTab (state, activeTab) {
      state.activeTab = activeTab
    },
    setActivePaper (state, paper) {
      state.activePaper = paper
    },
    setActiveMember (state, member) {
      state.activeMember = member
    },
    setActiveAlbum (state, album) {
      state.activeAlbum = album
    },
    setPaperListBlur (state, blur) {
      state.paperListBlur = blur
    },
    setMemberListBlur (state, blur) {
      state.memberListBlur = blur
    },
    setAlbumListBlur (state, blur) {
      state.albumListBlur = blur
    }
  }
})

export default store
